package com.ce.pms.occupation.model;

// Generated 2008-12-24 13:41:51 by Hibernate Tools 3.2.0.b9

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.AttributeOverride;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.ce.pms.common.model.SysInfo;
import com.ce.pms.common.util.BigDecimalUtil;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称: 入伙预缴费 关联数据表:OM_OCCUPATION_CHARGE
 *
 * @author yandawei
 * @CreateDate:2008-12-24
 */
@Entity
@Table(name = "OM_OCCUPATION_CHARGE")
public class OccupationChargeDO implements IDomainObject {

	/**
	 * 主键
	 */
	@Id
	@GeneratedValue
	@Column(name = "OCCUPATION_CHARGE_ID", unique = true, nullable = false)
	private Long keyword;


	/**
	 * 身份验证DO
	 */
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IDENTITY_VALIDATE_ID", nullable = false)
	private IdentityValidateDO identityValidate;

	/**
	 * 预付款总额
	 */
	@Column(name = "PREPAY_SUM", precision = 18, scale = 2)
	private BigDecimal prepaySum = new BigDecimal("000",BigDecimalUtil.getMathContext());

	@OneToMany(fetch = FetchType.LAZY,mappedBy="occupationCharge")
	@org.hibernate.annotations.Cascade(value = { org.hibernate.annotations.CascadeType.SAVE_UPDATE })
//	@JoinColumn(name="OCCUPATION_CHARGE_ITEM_CONFIG_ID")
	private Set<OccupationChargeItemDO> chargeItems = new HashSet<OccupationChargeItemDO>();

	/**
	 * 系统信息
	 *
	 */
	@Embedded
	@AttributeOverride(name="sysDate",column=@Column(name="SYS_DATE"))
	private SysInfo sysInfo;

	public OccupationChargeDO() {
	}

	public OccupationChargeDO(Long keyword) {
		this.keyword = keyword;
	}

	public IdentityValidateDO getIdentityValidate() {
		return identityValidate;
	}

	public void setIdentityValidate(IdentityValidateDO identityValidate) {
		this.identityValidate = identityValidate;
	}

	public Long getKeyword() {
		return keyword;
	}

	public void setKeyword(Long keyword) {
		this.keyword = keyword;
	}


	public SysInfo getSysInfo() {
		return sysInfo;
	}

	public void setSysInfo(SysInfo sysInfo) {
		this.sysInfo = sysInfo;
	}

	public BigDecimal getPrepaySum() {
		return prepaySum;
	}

	public void setPrepaySum(BigDecimal prepaySum) {
		this.prepaySum = prepaySum;
	}

	public Set<OccupationChargeItemDO> getChargeItems() {
		return chargeItems;
	}

	public void setChargeItems(Set<OccupationChargeItemDO> chargeItems) {
		this.chargeItems = chargeItems;
	}

}
